package com.example.dllo.moondog.information;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by dllo on 16/3/2.
 */
public class InformationAdapter extends FragmentPagerAdapter{
    private List<Fragment> data;
    private Context context;

    String title1 = "最新";
    String title2 = "官方";
    String title3 = "活动";
    String title4 = "攻略";

    String[] titles = {title1,title2,title3,title4};

    public InformationAdapter(FragmentManager fm, List<Fragment> data, Context context) {
        super(fm);
        this.data = data;
        this.context = context;

    }

    @Override
    public Fragment getItem(int position) {
        return data.get(position);
    }

    @Override
    public int getCount() {
        return data.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
